package com.zxbg.dao;

import com.zxbg.domain.InfoBlockType;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface InfoBlockTypeDao {
    @Select("select * from info_block_type where belong_block_id = #{belong_block_id} and tenant_id = #{tenant_id}")
    public List<InfoBlockType> getBlockTypeByBlockId(@Param("belong_block_id") String belong_block_id, @Param("tenant_id") Integer tenant_id);

    @Update("update info_block_type set type_name = #{type_name} where type_id = #{type_id}")
    public Integer updateTypeNameByTypeId(@Param("type_name") String type_name, @Param("type_id") Integer type_id);

    @Delete("delete from info_block_type where type_id = #{type_id}")
    public Integer deleteInfoBlockTypeByTypeId(Integer type_id);

    @Insert("insert into info_block_type values(null, #{belong_block_id}, #{tenant_id}, #{type_name})")
    public Integer addInfoBlockType(InfoBlockType infoBlockType);

    @Select("select * from info_block_type where type_id = #{type_id}")
    public InfoBlockType getBlockTypeByTypeId(Integer type_id);
}
